-- GENERATED SPELL FOR [Boneguard Commander] --


function spell0_34127(pUnit, Event) --@Charge,n/a--
pUnit:FullCastSpellOnTarget(63010,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_34127', 0, 1)
end

function spell1_34127(pUnit, Event) --@Scourge Banner Aura,Self--
pUnit:FullCastSpellOnTarget(60023,pUnit)
pUnit:RegisterEvent('Sorts_34127', 576, 1)
end

function spell2_34127(pUnit, Event) --@Scourge Banner-Bearer,Self--
pUnit:FullCastSpellOnTarget(59942,pUnit)
pUnit:RegisterEvent('Sorts_34127', 609, 1)
end

function spell3_34127(pUnit, Event) --@Shield-Breaker,n/a--
pUnit:FullCastSpellOnTarget(65147,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_34127', 250, 1)
end

function Sorts_34127(pUnit, Event)
local choix_sorts_34127 = math.random(0, 3)
if choix_sorts_34127 == 0 then
pUnit:RegisterEvent('spell0_34127', 1, 1)
end
if choix_sorts_34127 == 1 then
pUnit:RegisterEvent('spell1_34127', 1, 1)
end
if choix_sorts_34127 == 2 then
pUnit:RegisterEvent('spell2_34127', 1, 1)
end
if choix_sorts_34127 == 3 then
pUnit:RegisterEvent('spell3_34127', 1, 1)
end
end

function mob34127_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_34127', math.random(1500, 3000), 1)
end

function mob34127_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob34127_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob34127_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(34127, 1, 'mob34127_Action')
RegisterUnitEvent(34127, 2, 'mob34127_Leave')
RegisterUnitEvent(34127, 3, 'mob34127_Kill')
RegisterUnitEvent(34127, 4, 'mob34127_Die')
